
const mongoose = require('mongoose');
const _ = require('lodash');
var dishTypeService = require('../service/dishType.service');

module.exports={
    findAllDishType:findAllDishType
};

/**
 *
 * @param req
 * @param res
 * @param next
 */
function findAllDishType(req,res,next){

    dishTypeService.findAllDishType(function(err,data){
        if(err){
            res.json({result:false,errMsg:Error(err)});
        }else {
            if(_.isEmpty(data)){
                res.json({result: false, errMsg:'No dishType!'});
            }
            else {
                res.json({result: true, data: data});
            }
        }
    });

}
